package com.woniu.micropropertyserver.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.microcommonsserver.entity.PassInfoEntity;
import com.woniu.micropropertyserver.bean.DeployPass;
import com.woniu.micropropertyserver.mapper.PassInfoMapper;
import com.woniu.micropropertyserver.service.IPassInfoService;
import com.woniu.micropropertyserver.util.PageRest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：bb
 * @date ：Created in 2021/2/1 0001
 * @description：
 * @modified By：
 * @version: $
 */
@Transactional(readOnly = true)
@Service
public class PassInfoServiceImpl  implements IPassInfoService {

   @Resource
   private PassInfoMapper passInfoMapper;
    @Override
    public PageInfo<PassInfoEntity> findByParam(PageRest pageRest, DeployPass deployPass) {
        return PageHelper.startPage(pageRest.getPageNum(),pageRest.getPageSize()).doSelectPageInfo(()->passInfoMapper.findByParam(pageRest,deployPass));
    }

    @Override
    public PassInfoEntity findById(Long id) {
        return passInfoMapper.findById(id);
    }

    @Override
    public List<PassInfoEntity> findAll() {
        return passInfoMapper.findAll();
    }
}
